package _06获取Stream流;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.stream.Stream;

public class DemoGetStream {
    public static void main(String[] args) {

//        stream()方法
        //单列集合--list集合
        ArrayList<Integer> list = new ArrayList<>();
        Collections.addAll(list,11,22,33);

        //获取Stream流对象
        Stream<Integer> listStream = list.stream();

        //单列集合--Set集合
        HashSet<Integer> set = new HashSet<>();
        Collections.addAll(set,11,22,33);
        Stream<Integer> setStream = set.stream();

        //双列集合--Map
        HashMap<String,Integer> map = new HashMap<>();
        Stream<String> keysStream = map.keySet().stream();
        Stream<Integer> ValuesStream = map.values().stream();

        //静态of方法
        Stream<Integer> integerStream = Stream.of(11, 22, 33, 44);

    }
}
